package edu.sctu.alex.May.day20150503;
import java.util.Scanner;

/**
 * Created by user03 on 2015/5/4.
 */
public class CalculatorMethods {
    public void methods() {
        int result;

        Scanner me = new Scanner(System.in);
        Counter counter = new Counter();

        System.out.println("please input your method:");
        String temp = me.next();


        if (temp.equals("plus")) {

            System.out.println("please input two values :");
            int op1 = me.nextInt();
            int op2 = me.nextInt();

            result = counter.plus(op1, op2);

            System.out.println(op1 + "+" + op2 + "=" + result);

        } else if (temp.equals("sub")) {
            System.out.println("please input two values :");

            int op1 = me.nextInt();
            int op2 = me.nextInt();

            result = counter.sub(op1, op2);

            System.out.println(op1 + "-" + op2 + "=" + result);

        } else if (temp.equals("mult")) {
            System.out.println("please input two values :");

            int op1 = me.nextInt();
            int op2 = me.nextInt();

            result = counter.mult(op1, op2);

            System.out.println(op1 + "*" + op2 + "=" + result);

        } else if (temp.equals("div")) {
            System.out.println("please input two values :");

            int op1 = me.nextInt();
            int op2 = me.nextInt();

            result = counter.div(op1, op2);

            System.out.println(op1 + "/" + op2 + "=" + result);

        }else{
            System.out.println("The method is nonentity,please run again.");
        }


    }
}


